package android.slc.icr.core.room.manager;

import android.slc.icr.core.entity.IcrChartRoom;
import android.slc.icr.core.entity.IcrMessage;
import android.slc.icr.service.IcrMessageRemoteService;
import android.slc.icr.service.IcrPersistenceService;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;

import java.util.List;

/**
 * @author slc
 * @date 2022/05/10 下午 1:08
 */
public interface IChartRoomManager extends Observer<IcrMessage> {

    @Override
    default void onSubscribe(@NonNull Disposable disposable) {
    }

    @Override
    default void onError(@NonNull Throwable throwable) {
    }

    @Override
    default void onComplete() {
    }

    @Override
    default void onNext(@NonNull IcrMessage message) {
        try {
            onMessage(message);
        } catch (Exception e) {

        }
    }

    String getRoomMsgType();

    void setMustParam(IcrMessageRemoteService icrMessageRemoteService, IcrPersistenceService icrPersistenceService);

    void receiveMessage(IcrMessage message);

    void onMessage(IcrMessage message) throws Exception;

    List<IcrChartRoom> getOnlyReadChartRoomList();

    IcrChartRoom findOnlyReadChartRoomByRoomId(String roomId);


}
